#include <iostream>
#include <string>

using namespace std;

struct Student {
    string name;
    int age;
    int score;
};

// 值传递，拷贝一份新的结构体
void printStudent(struct Student stu) {
    cout << stu.name << " " << stu.age << " " << stu.score << endl;
}

// 地址传递，直接操作原来的结构体
void printStudent2(struct Student* stu) {
    cout << stu->name << " " << stu->age << " " << stu->score << endl;
}

int main() {
    struct Student stu1 = {"Tom", 18, 100};
    struct Student stu2 = stu1; // stu2 is a copy of stu1

    // cout << stu2.name << " " << stu2.age << " " << stu2.score << endl;
    printStudent(stu2);
    printStudent2(&stu2);
    
    return 0;
}
